home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / JFC.bin / DebugGraphicsObserver.java < prev    next >
Text File  |  1998-06-30  |  2KB  |  50 lines

  1. /*
  2.  * @(#)DebugGraphicsObserver.java    1.4 98/01/30
  3.  *
  4.  * Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  */
  20.  
  21. package com.sun.java.swing;
  22.  
  23. import java.awt.*;
  24. import java.awt.image.*;
  25.  
  26. /** ImageObserver for DebugGraphics, used for images only.
  27.   * 
  28.   * @version 1.4 01/30/98
  29.   * @author Dave Karlton
  30.   */
  31. class DebugGraphicsObserver implements ImageObserver {
  32.     int lastInfo;
  33.  
  34.     synchronized boolean allBitsPresent() {
  35.         return (lastInfo & ImageObserver.ALLBITS) != 0;
  36.     }
  37.  
  38.     synchronized boolean imageHasProblem() {
  39.         return ((lastInfo & ImageObserver.ERROR) != 0 ||
  40.                 (lastInfo & ImageObserver.ABORT) != 0);
  41.     }
  42.  
  43.     public synchronized boolean imageUpdate(Image img, int infoflags,
  44.                                             int x, int y,
  45.                                             int width, int height) {
  46.         lastInfo = infoflags;
  47.         return true;
  48.     }
  49. }
  50.